<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		
		//清空缓存
		function clearCache(){
			var parameter = {};
			//服务预约列表信息
			url = "${ctx}/sys/dict/clearCache";
			$.ajax({
				 type: "post",
				 url: url,
				 dataType : 'json',
				 data: parameter,
				 success: function(data, textStatus){
					alert('清空完毕');
				 },
				 complete: function(XMLHttpRequest, textStatus){
				 },
				 error: function(){
				 }
			});
		};
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/dict/list?type=${dict.type}">字典列表</a></li>
		<li><a href="${ctx}/sys/dict/form?sort=10&&type=${dict.type}">字典添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="dict" action="${ctx}/sys/dict/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>枚举类型：</label>
				<form:select id="type" path="type" class="input-medium"><form:option value="${type}" label="${type}"/><form:options items="${typeList}" htmlEscape="false"/></form:select>
			</li>
			<li><label>枚举描述：</label>
				<form:input path="description" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="button" onclick="clearCache()" value="清空缓存"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>id</th>
				<th>枚举类型</th>
				<th>枚举值</th>
				<th>枚举显示</th>
				<th>枚举描述</th>
				<th>排序</th>
				<th>父节点</th>
				<th>路径</th>
				<th>更新时间</th>
				<th>备注</th>
				<shiro:hasPermission name="dict:dict:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="dict">
			<tr>
				<td><a href="${ctx}/sys/dict/form?id=${dict.id}">
					${dict.id}
				</a></td>
				<td>
					${dict.type}
				</td>
				<td>
					${dict.code}
				</td>
				<td>
					${dict.label}
				</td>
				<td>
					${dict.description}
				</td>
				<td>
					${dict.sort}
				</td>
				<td>
					${dict.parentId}
				</td>
				<td>
					${dict.path}
				</td>
				<td>
					<fmt:formatDate value="${dict.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${dict.remarks}
				</td>
				<td>
    				<a href="${ctx}/sys/dict/form?id=${dict.id}">修改</a>
					<a href="${ctx}/sys/dict/delete?id=${dict.id}" onclick="return confirmx('确认要删除该枚举管理吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>